package com.starview.star.compiler.util;

/**
 * A Sequencer is similar to an Iterator, except that there is a known index and can move in either
 * direction
 * 
 * @author fgm
 * 
 */
public interface Sequencer<T>
{
  int index();

  T peek();

  T next();

  T prev();

  boolean hasNext();

  boolean hasPrev();

  @SuppressWarnings("serial")
  public static class SequenceException extends Error
  {
    public SequenceException(String msg)
    {
      super(msg);
    }
  }
}
